#pragma once

#include <DShow.h>

class DirectShow
{
private:
	DirectShow();							// private ctor, allowing this to only be used via the Engine() call (singleton)
	IGraphBuilder*		m_pGraphBuilder;	// used to set up media control and events
	IMediaControl*		m_pMediaControl;	// controls streaming
	IMediaEvent*		m_pMediaEvent;		// receives events from the filter graph
	IVideoWindow*		m_pVideoWindow;
	HWND				m_hWnd;
	bool isPlaying;							// flags true if the video is currently playing
	bool isFinished;						// flags true if the video has already cleaned up after playing
	bool bInitialized;

public:
	static inline DirectShow* Engine()	// function used to access the singleton
	{
		static DirectShow ds;
		return &ds;
	}

	bool Init(HWND hWnd);
	bool PlayVideo();			// returns true until the video is playing
	~DirectShow();				// cleanup
};